<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('行政处理')" />
    <link rel="stylesheet" href="../../../../../../../../../../../../css/navigation.css">
</head>
<body class="gray-bg">
<div class="navigation visible-xs-block">
    <ol class="breadcrumb">
        <span> > </span>
        <li><a href="#" onclick="gomain()">主页</a></li>
        <li style="color: black">行政处理</li>
    </ol>
    <div class="aLine"></div>
</div>
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
<!--                        <li>-->
<!--                            <label>劳务金额	：</label>-->
<!--                            <input type="text" name="dCost"/>-->
<!--                        </li>-->
<!--                        <li>-->
<!--                            <label>供应商名称/应付单位名称：</label>-->
<!--                            <input type="text" name="dSupplierName"/>-->
<!--                        </li>-->
<!--                        <li>-->
<!--                            <label>申请人：</label>-->
<!--                            <input type="text" name="dProposer"/>-->
<!--                        </li>-->
<!--                        <li>-->
<!--                            <label>申请内容：</label>-->
<!--                            <input type="text" name="dApplicationContent"/>-->
<!--                        </li>-->
<!--                        <li class="select-time">-->
<!--                            <label>申请时间：</label>-->
<!--                            <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginDCreateTime]"/>-->
<!--                            <span>-</span>-->
<!--                            <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endDCreateTime]"/>-->
<!--                        </li>-->
<!--                        <li>-->
<!--                            <label>总项目关联：</label>-->
<!--                            <input type="text" name="pId"/>-->
<!--                        </li>-->
<!--                        <li>-->
<!--                            <label>照片：</label>-->
<!--                            <input type="text" name="dFile"/>-->
<!--                        </li>-->
<!--                        <li>-->
<!--                            <label>劳务合同：</label>-->
<!--                            <input type="text" name="aLabor"/>-->
<!--                        </li>-->
<!--                        <li>-->
<!--                            <label>申请状态：</label>-->
<!--                            <select name="aStatus">-->
<!--                                <option value="">所有</option>-->
<!--                            </select>-->
<!--                        </li>-->
<!--                        <li>-->
<!--                            <label>审批意见：</label>-->
<!--                            <input type="text" name="aOpinion"/>-->
<!--                        </li>-->
                        <li>
                            <label>文件名称：</label>
                            <input type="text" name="pFileName"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script src="../../../../../../../../../../../../js/breadcrumb.js"></script>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('ruoyi:from:edit')}]];
    var removeFlag = [[${@permission.hasPermi('ruoyi:from:remove')}]];
    var creadFlag = [[${@permission.hasPermi('ruoyi:from:add')}]];
    var aStatus = [[${@dict.getType('dept_status')}]];
    var prefix = ctx + "ruoyi/agr";
    var prefixs = ctx + "ruoyi/agr";
    var aprefix =ctx + "ruoyi/fromFinancialVerify";
    $(function() {
        var options = {
            url: prefixs + "/list",
            createUrl: aprefix + "/add/{id}",
            removeUrl: aprefix + "/remove",
            exportUrl: prefix + "/export",
            updateUrl: aprefix + "/edit/{id}",
            modalName:"行政处理列表",
            showColumns: false,
            detailView: true,
            mobileResponsive: false,
            cardView: true,
            onExpandRow: function (index, row, $detail) {
                initChildTable(index, row, $detail);
            },
            columns: [
                {
                    field: 'pId',
                    title: 'ID',
                    visible: false
                },

                {
                    field: 'pFileName',
                    title: '文件名称'
                },
                {
                    field: 'pTheHeir',
                    title: '上传人'
                },
                {
                    field: 'pTime',
                    title: '上传时间'
                },
                ]
        };
        $.table.init(options);
    });
    initChildTable = function (index, row, $detail) {
        var childTable = $detail.html('<table style="table-layout:fixed"></table>').find('table');
        $(childTable).bootstrapTable({
                url: aprefix + "/list",
                method: 'post',
                sidePagination: "server",
                contentType: "application/x-www-form-urlencoded",
                queryParams: {
                    pId:row.pId
                },
                columns: [

                    {
                        field: 'aLabor',
                        title: '劳务合同',
                        width: 100,
                    },
                    {
                        field: 'dCost',
                        title: '劳务金额',
                        width: 100,
                    },
                    {
                        field: 'dSupplierName',
                        title: '供应商名称/应付单位名称',
                        width: 150,
                    },
                    {
                        field: 'dProposer',
                        title: '申请人',
                        width: 100,
                    },
                    {
                        field: 'dApplicationContent',
                        title: '申请内容',
                        width: 100,
                    },
                    {
                        field: 'dCreateTime',
                        title: '申请时间',
                        width: 100,
                    },
                    {
                        field: 'dFile',
                        title: '照片',
                        width: 100,
                        align: "center",
                        formatter: function(value, row, index) {
                            return $.table.imageView(value);
                        }
                    },
                    {
                        field: 'pId',
                        title: '工程合同及补充协议关联',
                        visible: false
                    },
                    {
                        field: 'aStatus',
                        title: '申请状态',
                        width: 100,
                        align: "center",
                        formatter: function(value, row, index) {
                            return $.table.selectDictLabel(aStatus, value);
                        }
                    },
                    {
                        field: 'aOpinion',
                        title: '审批意见',
                        width: 100,
                    },
                    {
                        title: '操作',
                        width: 100,
                        align: 'center',
                        formatter: function(value, row, index) {

                            var actions = [];
                            if (row.aStatus==2){
                                actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="consents(\'' + row.dId + '\')"><i class="fa fa-user"></i> 处理</a> ');
                            }
                            return actions.join('');
                        }
                    }

                ]
            }
        );
    };
    function consents(dId) {

        $.modal.confirm("确认要通过申请吗?", function() {
            var url = aprefix + "/consents";
            var data = { "dId": dId };
            $.operate.submit(url, "post", "json", data);
        });
    }
</script>
</body>
</html>